#计算圆周率——无穷级数法
def calculate_pi(threshold):
    pi_over_4 = 0
    denominator = 1
    sign = 1

    while True:
        term = sign / denominator
        if abs(term) <= threshold:
            break
        
        pi_over_4 += term
        denominator += 2
        sign = -sign  
    pi = pi_over_4 * 4
    return pi

if __name__ == "__main__":
    threshold = float(input())
    pi_value = calculate_pi(threshold)
    print(f"{pi_value:.8f}")